﻿
@{
    ViewBag.Title = "HiddenTroubleAdd";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="FacAndEquController" ng-init="SearchModel={};page='@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     PageName='@Request.CurrentExecutionFilePath.Substring(Request.CurrentExecutionFilePath.LastIndexOf("/") + 1)';
     GetAssetCardPageList(SearchModel,page);
     ">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />

			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <div class="page-heading">
        <h1>资产管理</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>现场管理</a></li>
        <li><a>设备设施</a></li>
        <li class="active"><a>资产管理</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2>筛选条件</h2></div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">名称：</label>
                                <div class="col-sm-2">
                                    <input type="text" ng-model="SearchModel.AssetName" placeholder="设施设备名称模糊查询" class="form-control"  />
                                </div>
                                <label class="col-sm-1 control-label">型号：</label>
                                <div class="col-sm-2">
                                    <input type="text" ng-model="SearchModel.ModelNo" placeholder="设备型号模糊查询" class="form-control"  />
                                </div>
                                <label class="col-sm-1 control-label">部门：</label>
                                <div class="col-sm-2">
                                    <input type="text" ng-model="SearchModel.DepName" placeholder="设备部门模糊查询" class="form-control"  />
                                </div>
                                <button class="btn btn-primary" ng-click="GetAssetCardPageList(SearchModel);">搜索</button>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h2>资产管理 总数：<b ng-bind="TotalCount"></b></h2>
                        <div class="panel-ctrls">
                            <div class="btn-group">
                               
                            </div>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="text-center" ng-show="PageLoading">
                            <img src="~/Assets/img/loading.gif" />
                        </div>
                        <table class="table table-striped table-bordered table-hover" ng-show="!PageLoading">
                            <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>资产编号</th>
                                    <th>所在场所</th>
                                    <th>资产名称</th>
                                    <th>资产类型</th>
                                    <th>所属部门</th>
                                    <th>数量</th>
                                    <th>型号</th>
                                    <th>使用状态</th>
                                    <th>使用人</th>
                                    <th>资产状态</th>
                                    <th>上次维保时间</th>
                                    <th>下次维保时间</th>
                                    <th>备注</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-show="DeviceList.length==0 && !PageLoading">
                                    <td colspan="12" style="text-align:center;vertical-align:middle;line-height:30px;">没有数据</td>
                                </tr>
                                <tr ng-repeat="x in DeviceList">
                                    <td>
                                        <span ng-bind="$index+1"></span>
                                    </td>
                                    <td>
                                        <span>{{x.AssetNo}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.AssetPlace}}</span>
                                    </td>

                                    <td>
                                        <span>{{x.AssetName}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.TypeName}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.DepName}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.Quantity}}</span>
                                    </td>

                                    <td>
                                        <span>{{x.ModelNo}}</span>
                                    </td>

                                    <td>
                                        <span>{{x.UseStates}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.UseEmployee}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.Status|GetAssetCardStatus}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.LastMaintance.MaintainceDate | JSONDate:'yyyy-MM-dd'}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.LastMaintance.NextDate | JSONDate:'yyyy-MM-dd'}}</span>
                                    </td>
                                    <td>
                                        <span>{{x.Remark}}</span>
                                    </td>
                                    <td>
                                        <a class="btn btn-primary btn-xs btn-label" ng-show="@ViewBag.IsModify==1" data-toggle="modal" href="#AddMaintanceModal" ng-click="GetCurrentDevice(x);"><i class="fa fa-wrench"></i>维保</a>
                                      
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="text-center" ng-show="DeviceList!=null && DeviceList.length>0">
                    <ul class="pagination  justify-content-center">
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetAssetCardPageList(SearchModel,1);">首页</a></li>
                        <li class="page-item" ng-class="{'active':result.currentPage==page}" ng-repeat="page in result.pages"><a style="cursor:pointer;" ng-click="GetAssetCardPageList(SearchModel,page)" class="page-link" ng-bind="page"></a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetAssetCardPageList(SearchModel,(result.currentPage + 1 > result.totalPage ? result.totalPage : result.currentPage + 1))">下一页</a></li>
                        <li class="page-item"><a class="page-link" style="cursor:pointer;" ng-click="GetAssetCardPageList(SearchModel,result.totalPage);">尾页</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="AddMaintanceModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="min-width:1250px;">
            <div class="modal-content" style="min-height: 700px;">
                <div class="modal-header">
                    <button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h2 class="modal-title">添加维保记录</h2>
                </div>
                <div class="modal-body" style="min-height: 660px;">
                    <div class="row">
                        <form class="form-horizontal row-border">
                            <div class="col-lg-12">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">维保公司：</label>
                                    <div class="col-sm-8">
                                        <input type="text" class="form-control" ng-model="AddModel.CompanyName" maxlength="500" readonly />
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">维保时间：</label>
                                    <div class="col-sm-8">
                                        <datepicker id="startTime" option="datetimeOption" format="L" ng-model="AddModel.MaintainceDate" ng-init="AddModel.MaintainceDate='@DateTime.Now.ToString("yyyy-MM-dd")'"></datepicker>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">下次维保时间：</label>
                                    <div class="col-sm-8">
                                        <datepicker id="startTime" option="datetimeOption" format="L" ng-model="AddModel.NextDate"></datepicker>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">备注：</label>
                                    <div class="col-sm-8">
                                        <input type="text" class="form-control" ng-model="AddModel.Remark" maxlength="500" />
                                    </div>
                                </div>
                            </div>

                        </form>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn btn-primary" ng-click="">提交</button>
                </div>
            </div>
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
</div>


@section Js{
    <script src="~/Assets/js/libs/moment.min.js"></script>
    <script src="~/Assets/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/Assets/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/Assets/js/libs/angularjs-datepicker.js"></script>
    <script src="~/Assets/js/libs/fileinput.js"></script>
    <script src="~/Assets/js/libs/zh.js"></script>
    <script src="~/Assets/js/pg/FacAndEqu.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
}
